<template>
    <el-form label-width="80px" v-loading="loading">
        <el-form-item label="添加科室:">
            <el-input type="text" v-model="dept.deptName" />
        </el-form-item>
        <el-form-item label="确认操作:">
            <el-button style="width: 100%" @click="addDept">
                确认修改
            </el-button>
        </el-form-item>
    </el-form>
</template>

<script>
    import utils from "@/Utils";
    export default {
        name: "SystemPopupAddDept.vue",
        data(){
            return{
                dept:{deptName:''},
                loading:false,
                utils
            }
        },
        methods:{
            addDept:function () {
                const dept=this.dept;
                if (this.utils.isEmpty(dept.deptName)) {
                    this.utils.tipsMessage("请不要留空",1);
                    return
                }
                this.axios.post("/Dept/isLogin/isSystemAdmin/addDept",{
                    deptName:dept.deptName
                }).then((req)=>{
                    const data=req.data;
                    if(data.code>0){
                        this.utils.tipsMessage(data.error,data.code);
                        return
                    }
                    this.utils.tipsMessage(data.data,data.code);
                    this.dept.deptName='';
                })
            }
        }
    }
</script>

<style scoped>

</style>